package inabit.expressioncompiler.productions;

import inabit.compiler.parser.grammar.NonTerminal;
import inabit.compiler.parser.grammar.Production;
import inabit.compiler.parser.grammar.Symbol;
import inabit.compiler.parser.grammar.Terminal;
import inabit.expressioncompiler.lexical.ExpressionTokenClass;
import inabit.expressioncompiler.parser.ExpressionSemanticAction;

/**G -> string_cte*/
/**@author Rafael Rocha*/
public class G_Rule2 extends Production{
	private Terminal string_cte;
	
	public G_Rule2() {
		super("G");
	}
	
	public Symbol[] production(final NonTerminal nonTerminal) {
		string_cte = new Terminal(ExpressionTokenClass.STRING_CTE);
		Symbol[] symbols = {
				string_cte,
				new ExpressionSemanticAction(nonTerminal) {
					
					@Override
					public void execute() throws Exception {
						nonTerminal.code = string_cte.getValue();
					}
				}
		};
		return symbols;
	}
}
